#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

from typing import Protocol

from cmk.ccc.plugin_registry import Registry


class ModePermissionsEnsurance(Protocol):
    @classmethod
    def name(cls) -> str: ...

    def ensure_permissions(self) -> None: ...


class ModePermissionsEnsuranceRegistry(Registry[type[ModePermissionsEnsurance]]):
    def plugin_name(self, instance: type[ModePermissionsEnsurance]) -> str:
        return instance.name()


mode_permissions_ensurance_registry = ModePermissionsEnsuranceRegistry()
